-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop using XDG_RUNTIME_DIR #143
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After years of trying to make this work, I've reluctantly come to the conclusion that XDG_RUNTIME_DIR is, for us, more trouble than it's worth. Three problems in particular have led to this: 1. When Jupyter runs as a server, e.g. with screen or nohup, XDG_RUNTIME_DIR can be deleted from under us if the user logs out. I haven't found any good way to prevent this. 2. The spec allows files to be automatically cleaned up after a few hours. In theory this can be prevented by setting the sticky bit, but it's not clear where it needs to be set, and we can't be sure that all systems actually respect that. 3. Sometimes the environment variable is automatically carried over from a context where it's accurate to a context where it's not. It's definitely not the only environment variable for which this can happen, but since it's set at login by many modern Linux systems, it's an obvious source of problems. Set against this, the benefits of XDG_RUNTIME_DIR: - The system should ensure that it is readable and writable only to the user who owns it. It doesn't save us any complexity, because we still try to make the same guarantees on platforms without XDG_RUNTIME_DIR, but it's nice to have an extra backstop against oversights by us or by our users. - It's reset on each boot, so if kernels or servers crash and don't clean up their connection files, those files don't last forever. It's nice to have, but again, we need to cope with leftover files for other platforms. - You can reliably use XDG_RUNTIME_DIR for objects like named pipes and Unix sockets, because it's guaranteed not to be on NFS. We do have an option to use Unix sockets for ZMQ connections, but as far as I know, it's rarely used. We can find other ways to use it for that specific purpose if necessary.
@minrk I think this would let us simplify some code, avoid some weird bugs, and generally bring things on Linux more in line with other platforms. I like the idea of XDG_RUNTIME_DIR, but in practice it's a pain to work with. |
Hurrah! cc @captainsafia who added support for XDG_RUNTIME_DIR to the nteract js version of this package |
cmd-ntrf
added a commit
to ComputeCanada/puppet-jupyterhub
that referenced
this pull request
Aug 30, 2023
Since Jun 13, 2019, by PR jupyter/jupyter_core#143, XDG_RUNTIME_DIR is no longer used by Jupyter to determine where to store its runtime file. If we leave JUPYTER_RUNTIME_DIR unset, the runtime files are stored in the user's home, which can cause performance issue when the home is on a network filesystem like NFS or Lustre.
cmd-ntrf
added a commit
to cmd-ntrf/jupyter
that referenced
this pull request
Aug 30, 2023
Since [jupyter_core PR jupyter#143](jupyter/jupyter_core#143), XDG_RUNTIME_DIR is no longer used to set Jupyter runtime dir, and the default on all platforms is `(data_dir)/runtime`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After years of trying to make this work, I've reluctantly come to the conclusion that XDG_RUNTIME_DIR is, for us, more trouble than it's worth.
Three problems in particular have led to this:
but since it's set at login by many modern Linux systems, it's an obvious source of problems.
Set against this, the benefits of XDG_RUNTIME_DIR:
platforms.